This invention relates generally to databases, and more particularly to management of non-persistent data in a persistent database.
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. The following notice applies to the software and data as described below and in the drawings attached hereto: Copyright(copyright) 1998, Microsoft Corporation, All Rights Reserved.
A prevalent type of database today is a relational database. A relational database is a collection of data items organized as a set of formally-described tables from which data can be accessed in many different ways without having to reorganize the database tables. A view is a particular way of accessing the data items in a database. A single database can support numerous different views. Typically, a view arranges the data in some order and makes only certain components of the data visible. The different views do not affect the physical organization of the database tables.
Each table (also referred to as a relation) contains one or more data categories organized in columns. The names of the columns of the table are referred to as attributes. A row of a table contains a unique instance of data for the categories defined by the columns. Each row has one component for each attribute of the table. The name of the table and the set of attributes for the table are together referred to as the schema for that particular table.
Although the rows of a table are frequently modified, it is less common for the schema of a table to change. However, there are situations where a user might want to add or delete attributes. Schema changes, while possible in commercial database systems, are very expensive and inefficient because each one of the perhaps millions of rows need to be rewritten to add or delete components. If an attribute is added, for example, it may be difficult or even impossible to find the correct value for the new component of the rows.
When a database is extended to include additional data such as new rows or columns, the additional data becomes a permanent part of the database. However, a user often does not want to modify the data permanently. For example, in some cases it is desirable to enhance or manipulate large amounts of data that already exists in a database while retaining the original state of the database. One method of enhancing and manipulating data without changing the original state of a database is to store the new data separate from the original data. For example, new data is stored in a separate table. However, performance suffers when this method is used. More time and system resources are required to access and manipulate data stored in multiple locations than if the data were integrated and stored in the same location.
Therefore, a database system is needed which permits new data to be added to a table without requiring that the original state of the table be modified. What is also needed is a database system that permits the new data to be seamlessly integrated with the original data for manipulation.
The above-mentioned shortcomings, disadvantages and problems are addressed by the present invention, which will be understood by reading and studying the following specification. This invention relates to management of non-persistent data in a persistent database.
A method of managing non-persistent data in a persistent database includes adding the non-persistent data to the database in the form of a temporary entry. The temporary entry can be a temporary row or column, a temporary table or a temporary database with temporary tables. The method also includes tracking the non-persistent data in order to maintain the original state of the persistent database. A column of temporary bits is added to track the rows, and the temporary columns are tracked via a bit in the schema.
A computerized system for managing non-persistent data in a persistent database includes a database containing persistent data and a database engine for maintaining the relational database. A database application program interface has special options for adding an entry containing non-persistent data to the relational database. The database engine integrates the non-persistent data into the relational database with the persistent data while the database exists in memory of a computer. The database engine ignores the non-persistent data in the relational database when writing the relational database to a computer readable medium so that an original state of the persistent data is preserved.
Non-persistent temporary entries can be added to any relational database to extend data while maintaining the original state of the database. Using temporary entries is advantageous when a large amount of data already exists in a database and a user needs to enhance and/or manipulate the data while still retaining the original or updated state of the data.